package com.zwps.biz.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum AlarmFlagEnum {
    BEGIN(1, "BEGIN"),
    END(2, "END"),
    UNKNOWN(0, "未知类型");
    private final int type;
    private final String description;
    public static int getTypeByDescription(String description) {
        for (AlarmFlagEnum identifyTypeEnum : values()) {
            if (identifyTypeEnum.getDescription().equals(description)) {
                return identifyTypeEnum.getType();
            }
        }
        return UNKNOWN.getType();
    }
}
